<extend name="Public/layout"/>
<block name="head">
    <link rel="stylesheet" href="__PUBLIC__css/push_index.css">
    <link rel="stylesheet" href="__PUBLIC__css/net-loan.css">
    <style type="text/css">
        body {
                background: #f4f5fa !important;
        }
    </style>
    <script src="__PUBLIC__js/util.js"></script>
</block>
<block name="main">

        <div class="header">
        <div class="seting" onclick="location.href='/Home/Person/setting'"></div>
          <div class="user_info">
            <div class="head-img"  onclick="changeAvatar()">
              <img id="uploadPreview"  src="{$user_info.url_img}" width='100%' height="100%">
              <input id="uploadImage" type="file" onchange="loadImageFile()" style="display: none;">
            </div>
            <div class="info_data">
                <h4><span>{$user_info.nickname}</span> <img src="__PUBLIC__images/ad-star.png"></h4>
                <span class="icon_num">8号金币：{$user_info.score}个</span>
            </div>
          </div>
        </div>
<!-- 
         <div class="head-push-info">
              <div class="push-info-top">
                  <ul>
                   <li><div class="p_listcontent"><b>{$recommend.year}</b><span>年</span></div> <h4>网贷投资</h4></li><div class="border-tp"></div>
                    <li><div class="p_listcontent"><b>{$recommend.platform_num}</b><span>个</span></div> <h4>投资平台</h4></li><div class="border-tp"></div>
                    <li><div class="p_listcontent"><b>{$recommend.pit_num}</b><span>次</span></div> <h4>踩雷次数</h4></li>
                  </ul>
              </div>
              <div class="push-info-bottom"><span>简介： <notempty name="recommend.introduce"> {:msubstr($recommend[introduce],0,14)} <else/> 这个家伙很懒，什么都没留下</notempty></span><a href="/Home/Person/edit_profile/id/{$user_info.id}">编辑资料></a></div>
        </div> -->
        <div class="clear"></div>
        <div class="person_tab">
                <ul>
                    <li><div onclick="location.href='/Home/Person/invest_push_index'" class="tab_img"><img src="__PUBLIC__images/icon_wd_yaoqing_nor.png"><div><span>我的邀请返利</span></li>
                    <li><div onclick="location.href='/Home/Person/invest_index'" class="tab_img">
                    <img src="/App/Home/Public/images/icon_wd_touzi_nor@2x.png" class="new_tab_img"><div><span>我的投资返利</span></li>
                    <li onclick="location.href='/Home/Person/send_pack'" ><div class="tab_img"><img src="__PUBLIC__images/icon_wd_hongbaot_nor.png"><div><span>邀请返利规则</span></li>
                </ul>
        </div>

        <div class="menu">
          <ul>
            <!-- <li <notempty name="user_info.bank_card"> onclick="location.href='/Home/Person/cash/val/1'" <else/>onclick="no_bank_card()" </notempty> > -->
			<li onclick="location.href='/Home/Person/cash/val/1'" >
              <div class="menu_list_img"><img src="__PUBLIC__images/icon_wd_yue_nor.png"></div> 
              <div class="menu_content"> <span>账户余额（提现点这里）</span><img class="more" src="__PUBLIC__images/icon_wd_r_nor.png"> <div class="f_content">{$user_info.prize_balance}元</div></div>
            </li>
<!--             <li>
              <div class="menu_list_img"><img src="__PUBLIC__images/icon_wd_touzi_nor.png"></div> 
              <div onclick="location.href='/Home/Person/invest_index'" class="menu_content"> <span>我的投资详情</span><img class="more" src="__PUBLIC__images/icon_wd_r_nor.png"></div>
            </li> -->
            <li>
              <div class="menu_list_img"><img src="__PUBLIC__images/icon_wd_quanzi_nor.png"></div> 
              <div onclick="location.href='/Home/Person/my_circle'" class="menu_content"> <span>返利平台动态</span><img class="more" src="__PUBLIC__images/icon_wd_r_nor.png"> <div class="f_content"></div></div>
            </li>
            <li onclick="location.href='/Home/Person/trade_details'" >
              <div class="menu_list_img"><img src="__PUBLIC__images/icon_wd_mingxi_nor.png"></div> 
              <div class="menu_content no_border"> <span>交易明细</span><img class="more" src="__PUBLIC__images/icon_wd_r_nor.png"></div>
            </li>
          </ul>
        </div>
            


        <div class="menu">
          <ul>
            <li>
              <div class="menu_list_img"><img src="__PUBLIC__images/icon_wd_gz_nor.png"></div> 
              <div onclick="location.href='/Home/Circle/pupil_list'" class="menu_content"> <span>我的徒弟</span><img class="more" src="__PUBLIC__images/icon_wd_r_nor.png"> <div class="f_content">徒弟{$count_user}个</div></div>
            </li>
            <li>
              <div class="menu_list_img"><img src="__PUBLIC__images/icon_wd_guandian_nor.png"></div> 
              <div onclick="location.href='/Home/Person/viewpoint'"  class="menu_content no_border"> <span>我发表的观点</span><img class="more" src="__PUBLIC__images/icon_wd_r_nor.png"></div>
            </li>

          </ul>
        </div>
        <div style="width:100%;height:1.82rem;float:left;"></div>
</block>
<block name="js">
    <script type="text/javascript">

        //    修改头像功能
        var oFReader = new FileReader();
        var rFilter = /^(?:image\/bmp|image\/cis\-cod|image\/gif|image\/ief|image\/jpeg|image\/jpeg|image\/jpeg|image\/pipeg|image\/png|image\/svg\+xml|image\/tiff|image\/x\-cmu\-raster|image\/x\-cmx|image\/x\-icon|image\/x\-portable\-anymap|image\/x\-portable\-bitmap|image\/x\-portable\-graymap|image\/x\-portable\-pixmap|image\/x\-rgb|image\/x\-xbitmap|image\/x\-xpixmap|image\/x\-xwindowdump)$/i;

        oFReader.onload = function (oFREvent) {
            document.getElementById("uploadPreview").src = oFREvent.target.result;
            $.post('/Home/Person/change_head_pic',{
                file:oFREvent.target.result
            },function(res){
                if(res.errorCode==1) {
                    layer.open({
                        content: res.msg
                        , skin: 'msg'
                        , time: 1
                    });
                }
            })
        };

        function loadImageFile() {
            if (document.getElementById("uploadImage").files.length === 0) { return; }
            var oFile = document.getElementById("uploadImage").files[0];
            if (!rFilter.test(oFile.type)) { alert("You must select a valid image file!"); return; }
            oFReader.readAsDataURL(oFile);
        }

        function changeAvatar() {

//        底部对话框
            layer.open({
                content: ''
                ,className: 'avatar-layer'
                ,btn: ['取消', '从相册选择']
                ,skin: 'footer'
                ,no: function () {
                    $('#uploadImage').click()
                    layer.closeAll()
                }
                ,yes: function(index){
                    layer.close(index);
                }
            });
        }


        function no_bank_card() {
            layer.open({
                content: "您还未绑定银行卡,请先绑定银行卡！"
                , btn: ['前往', '取消']
                , yes: function (index) {
                    location.href = "/Home/Person/bind_bank_card"
                }
            });
        }

  var title="{$user_info.nickname}的个人主页-8号金融街！"
  var desc = '8号金融街精选多家优质平台，稳健赚利息还有首投红包领！'
  var link="http://wei.8hjie.com/Home/Person/person_index/user_id/{$user_info.id}"
  var imgUrl='http://wei.8hjie.com/App/Home/Public/images/chat-icon.png' 


    </script>
</block>